﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HammerMUD.Commands;

namespace HammerMUD.Admin
{
    public class EditRoomCommand : Command
    {
        public EditRoomCommand()
        {
            Name = "editroom";
            Help = "editroom name <name>";
            SecurityLevel = SecurityLevel.Admin;
        }

        public override void Do(HammerMUD.System.User from, List<string> arguments)
        {
            if (arguments.Count < 3)
            {
                from.Send(Help);
                return;
            }

            if (arguments[1].Equals("name"))
            {
                String roomName = String.Empty;
                for(int i = 2; i < arguments.Count; i++)
                {
                    roomName = roomName + arguments[i] + " ";
                }
                roomName = roomName.Trim();

                from.UserAccount.CurrentCharacter.CurrentRoom.Name = roomName;
                from.Send("Name of the room changed to " + roomName);
                return;
            }

            from.Send("Sorry, editroom is not yet fully implemented!");
        }
    }
}
